package shop.services.front.offlineAccount.dao.impl;

import org.springframework.stereotype.Repository;
import shop.core.common.dao.BaseDao;
import shop.core.common.dao.page.PagerModel;
import shop.services.front.offlineAccount.bean.OfflineAccount;
import shop.services.front.offlineAccount.dao.OfflineAccountDao;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/4/22.
 */
@Repository("offlineAccountDaoFront")
public class OfflineAccountDaoImpl implements OfflineAccountDao {
    @Resource
    private BaseDao dao;
    public void setDao(BaseDao dao) {
        this.dao = dao;
    }

    public OfflineAccountDaoImpl() {
        super();
    }

    @Override
    public int insert(OfflineAccount offlineAccount) {
        return dao.insert("front.offlineAccount.insert", offlineAccount);
    }

    @Override
    public int delete(OfflineAccount offlineAccount) {
        return dao.delete("front.offlineAccount.delete",offlineAccount);
    }

    @Override
    public int update(OfflineAccount offlineAccount) {
        return dao.update("front.offlineAccount.update",offlineAccount);
    }

    @Override
    public OfflineAccount selectOne(OfflineAccount offlineAccount) {
        return (OfflineAccount) dao.selectOne("front.offlineAccount.selectOne",offlineAccount);
    }

    @Override
    public PagerModel selectPageList(OfflineAccount offlineAccount) {
        return null;
    }

    @Override
    public List<OfflineAccount> selectList(OfflineAccount offlineAccount) {
        return dao.selectList("front.offlineAccount.selectList",offlineAccount);
    }

    @Override
    public int deleteById(int id) {
        return 0;
    }

    @Override
    public OfflineAccount selectById(String id) {
        return (OfflineAccount) dao.selectOne("front.offlineAccount.selectById",id);
    }

    @Override
    public List<OfflineAccount> selectListByAccount(OfflineAccount offlineAccount) {
        return dao.selectList("front.offlineAccount.selectListByAccount",offlineAccount);
    }

    @Override
    public List<OfflineAccount> selectListByOffline(OfflineAccount offlineAccount) {
        return dao.selectList("front.offlineAccount.selectListByOffline",offlineAccount);
    }

    @Override
    public List<OfflineAccount> getRecords(OfflineAccount offlineAccount) {
        return dao.selectList("front.offlineAccount.getRecords",offlineAccount);
    }

    @Override
    public List<OfflineAccount> selectOverList(OfflineAccount offlineAccount) {
        return dao.selectList("front.offlineAccount.selectOverList",offlineAccount);
    }

    @Override
    public List<OfflineAccount> selectServiceTime(OfflineAccount offlineAccount) {
        return dao.selectList("front.offlineAccount.selectServiceTime",offlineAccount);
    }

    @Override
    public List<OfflineAccount> selectAstList(OfflineAccount offlineAccount) {
        return dao.selectList("front.offlineAccount.selectAstList",offlineAccount);
    }

    @Override
    public int getTotal(OfflineAccount offlineAccount) {
        OfflineAccount offlineAccount1=new OfflineAccount();
        offlineAccount1=(OfflineAccount)dao.selectOne("front.offlineAccount.getTotal",offlineAccount);
        return offlineAccount1.getTotalMoney();
    }
}
